<!DOCTYPE html>
<html class="x-admin-sm">

    <head>
        <meta charset="UTF-8">
        <title>欢迎页面-X-admin2.2</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="css/font.css">
        <link rel="stylesheet" href="css/xadmin.css">
        <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
        <script type="text/javascript" src="lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="js/xadmin.js"></script>
        <script type="text/javascript" src="js/mtable.js"></script>
        <script type="text/javascript" src="js/setData.js"></script>
        <script type="text/javascript" src="js/sendData.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
            <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
            <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]--></head>

    <body>
        <div class="layui-fluid">
            <div class="layui-row">
                <form class="layui-form">
                    <div class="pm">
                        <div class="layui-form-item" style="color: #F08080;">产品经理</div>
                        <div class="layui-form-item" id="pm_add">
                            <label for="username" class="layui-form-label">产品经理人数</label>
                            <div class="layui-input-inline">
                                <input type="number" min="0" placeholder="请输入产品经理人数"  id="pm_num" name="pm_num" autocomplete="off" class="layui-input"></div></div>
                            <input type="number" id="pm_hide_num" hidden="hidden" value="0">
                        <li id="pm_upload"></li></div>
                    <div class="app_designer">
                        <div class="layui-form-item" style="color: #F08080;">应用架构设计师</div>
                        <div class="layui-form-item" id="app_designer_add">
                            <label for="username" class="layui-form-label">应用架构设计师人数</label>
                            <div class="layui-input-inline">
                                <input type="number" min="0" placeholder="请输入应用架构设计师人数"  id="app_designer_num" name="app_designer_num" autocomplete="off" class="layui-input"></div></div>
                            <input type="number" id="app_designer_hide_num" hidden="hidden" value="0">
                        <li id="app_designer_upload"></li></div>
                    <div class="platform_designer">
                        <div class="layui-form-item" style="color: #F08080;">基础平台设计师</div>
                        <div class="layui-form-item" id="platform_designer_add">
                            <label for="username" class="layui-form-label">基础平台设计师人数</label>
                            <div class="layui-input-inline">
                                <input type="number" min="0" placeholder="请输入基础平台设计师人数"  id="platform_designer_num" name="platform_designer_num" autocomplete="off" class="layui-input"></div></div>
                            <input type="number" id="platform_designer_hide_num" hidden="hidden" value="0">
                        <li id="platform_designer_upload"></li></div>
                    <div class="client_designer">
                        <div class="layui-form-item" style="color: #F08080;">客户端(APP)设计师</div>
                        <div class="layui-form-item" id="client_designer_add">
                            <label for="username" class="layui-form-label">客户端(APP)设计师人数</label>
                            <div class="layui-input-inline">
                                <input type="number" min="0" placeholder="请输入客户端(APP)设计师人数"  id="client_designer_num" name="client_designer_num" autocomplete="off" class="layui-input"></div></div>
                            <input type="number" id="client_designer_hide_num" hidden="hidden" value="0">
                        <li id="client_designer_upload"></li></div>
                    <div class="web_designer">
                        <div class="layui-form-item" style="color: #F08080;">前端设计设计师</div>
                        <div class="layui-form-item" id="web_designer_add">
                            <label for="username" class="layui-form-label">前端设计设计师人数</label>
                            <div class="layui-input-inline">
                                <input type="number" min="0" placeholder="请输入前端设计设计师人数"  id="web_designer_num" name="web_designer_num" autocomplete="off" class="layui-input"></div></div>
                            <input type="number" id="web_designer_hide_num" hidden="hidden" value="0">
                        <li id="web_designer_upload"></li></div>
                    <div class="ui_designer">
                        <div class="layui-form-item" style="color: #F08080;">UI设计师</div>
                        <div class="layui-form-item" id="ui_designer_add">
                            <label for="username" class="layui-form-label">UI设计师人数</label>
                            <div class="layui-input-inline">
                                <input type="number" min="0" placeholder="请输入UI设计师人数"  id="ui_designer_num" name="ui_designer_num" autocomplete="off" class="layui-input"></div></div>
                            <input type="number" id="ui_designer_hide_num" hidden="hidden" value="0">
                        <li id="ui_designer_upload"></li></div>

<!--                    <button class="layui-btn layui-btn-danger" id="button_store" style="display:block; margin-bottom:20px; width: 80px;"  onclick="sendData(2)">
                            <i class="layui-icon"></i>保存</button>-->
                    <button class="layui-btn layui-btn-danger" id='button_store' value="2" style="display:block; margin-bottom:20px; width: 80px;"  lay-submit="" lay-filter="sendData">
                        <i class="layui-icon"></i>保存</button>
                </form>
            </div>
        </div>
        <script>
            var a=GetRequest();
            var tableId=a['tableId'];
            var xtsjCpjl=a['xtsjCpjl'];
            var xtsjYyjgsjs=a['xtsjYyjgsjs'];
            var xtsjJcptsjs=a['xtsjJcptsjs'];
            var xtsjKhdapisjs=a['xtsjKhdapisjs'];
            var xtsjQdsjfxs=a['xtsjQdsjfxs'];
            var xtsjUisjs=a['xtsjUisjs'];
            if(xtsjCpjl == 1)   pmMode();
                else $('.pm').hide();
            if(xtsjYyjgsjs == 1)  appDesignerMode();
                else $('.app_designer').hide();
            if(xtsjJcptsjs == 1)   platformDesignerMode();
                else $('.platform_designer').hide();
            if(xtsjKhdapisjs == 1)  clientDesignerMode();
                else $('.client_designer').hide();
            if(xtsjQdsjfxs == 1)   webDesignerMode();
                else $('.web_designer').hide();
            if(xtsjUisjs == 1)  uiDesignerMode();
                else $('.ui_designer').hide();

            var status=a['status'];
            if(tableId){
                $(window).load( function(){
                    initData(tableId, 2);
                    setTimeout(
                    function(){
                        var evtObj = document.createEvent('UIEvents');
                        evtObj.initUIEvent('input', true, true, window, 1 );
                        document.querySelector("#pm_num").dispatchEvent(evtObj);
                        document.querySelector("#app_designer_num").dispatchEvent(evtObj);
                        document.querySelector("#platform_designer_num").dispatchEvent(evtObj);
                        document.querySelector("#client_designer_num").dispatchEvent(evtObj);
                        document.querySelector("#web_designer_num").dispatchEvent(evtObj);
                        document.querySelector("#ui_designer_num").dispatchEvent(evtObj);
                        if(status==1) {
                            $('#button_store').hide();
                            $('#pm_num').attr("disabled","disabled");
                            $('#app_designer_num').attr("disabled","disabled");
                            $('#platform_designer_num').attr("disabled","disabled");
                            $('#client_designer_num').attr("disabled","disabled");
                            $('#web_designer_num').attr("disabled","disabled");
                            $('#ui_designer_num').attr("disabled","disabled");
                            var pmNum = $('#pm_num').val();
                            $('#pm_money').attr("disabled","disabled");
                            for (let i =1;i<=pmNum;++i) {
                                $('#pm_name_'+i).attr("disabled","disabled");
                                $('#pm_num_'+i).attr("disabled","disabled");
                                $('#pm_totalnum_'+i).attr("disabled","disabled");
                            }
                            var appDesignerNum = $('#app_designer_num').val();
                            $('#app_designer_money').attr("disabled","disabled");
                            for (let i =1;i<=appDesignerNum;++i) {
                                $('#app_designer_name_'+i).attr("disabled","disabled");
                                $('#app_designer_num_'+i).attr("disabled","disabled");
                                $('#app_designer_totalnum_'+i).attr("disabled","disabled");
                            }
                            var platformDesignerNum = $('#platform_designer_num').val();
                            $('#platform_designer_money').attr("disabled","disabled");
                            for (let i =1;i<=platformDesignerNum;++i) {
                                $('#platform_designer_name_'+i).attr("disabled","disabled");
                                $('#platform_designer_num_'+i).attr("disabled","disabled");
                                $('#platform_designer_totalnum_'+i).attr("disabled","disabled");
                            }
                            var clientDesignerNum = $('#client_designer_num').val();
                            $('#client_designer_money').attr("disabled","disabled");
                            for (let i =1;i<=clientDesignerNum;++i) {
                                $('#client_designer_name_'+i).attr("disabled","disabled");
                                $('#client_designer_num_'+i).attr("disabled","disabled");
                                $('#client_designer_totalnum_'+i).attr("disabled","disabled");
                            }
                            var webDesignerNum = $('#web_designer_num').val();
                            $('#web_designer_money').attr("disabled","disabled");
                            for (let i =1;i<=webDesignerNum;++i) {
                                $('#web_designer_name_'+i).attr("disabled","disabled");
                                $('#web_designer_num_'+i).attr("disabled","disabled");
                                $('#web_designer_totalnum_'+i).attr("disabled","disabled");
                            }
                            var uiDesignerNum = $('#ui_designer_num').val();
                            $('#ui_designer_money').attr("disabled","disabled");
                            for (let i =1;i<=uiDesignerNum;++i) {
                                $('#ui_designer_name_'+i).attr("disabled","disabled");
                                $('#ui_designer_num_'+i).attr("disabled","disabled");
                                $('#ui_designer_totalnum_'+i).attr("disabled","disabled");
                    }}},10)
                });
            };
        </script>
    </body>
</html>